#
# CANDS Makefile
#



MODULES_LIST = . server client ui
ROOT         = src

UI_FILES = $(wildcard $(ROOT)/ui/designer/*.ui )
PY_FROM_UI_FILES =  $(addprefix $(ROOT)/ui/,$(patsubst %.ui,ui_%.py,$(notdir $(UI_FILES))))


all : $(PY_FROM_UI_FILES)

test : 
	@echo "UI_FILES=$(UI_FILES)"
	@echo
	@echo "PY_FROM_UI_FILES=$(PY_FROM_UI_FILES)"

count :
	@total=$$((0));for moduleName in $(MODULES_LIST) ; do echo "Module: $$moduleName" ; wc -l $(ROOT)/$$moduleName/*.py ; moduleSize=`wc -l $(ROOT)/$$moduleName/*.py | grep "total" | awk '{  $$2="" ; print $$0 }'`; let total+=moduleSize; done;echo "Total : $$total"

	
#sdist : 
#	python setup.py sdist 
##	python setup.py sdist --force-manifest
#	
#bdist : 
#	python setup.py bdist
#egg : 
#	python setup.py bdist_egg
#	
#install : 
#	python setup.py install
#	
#develop : 
#	python setup.py develop

clean : 
	for moduleName in $(MODULES_LIST) ; do rm -f $(ROOT)/$$moduleName/*.pyc ; done  
	rm -f $(PY_FROM_UI_FILES)
	
#doc : 
#	/Applications/Doxygen.app/Contents/Resources/doxygen Doxyfile
	
stat : 
	svn log -v --xml > statFile.log
	java -jar ../statsvn-0.7.0/statsvn.jar statFile.log . -output-dir html -cache-dir cache

#layout :	
#	/Applications/Doxygen.app/Contents/Resources/doxygen -l layoutFileName.xml
	
$(ROOT)/ui/ui_%.py : $(ROOT)/ui/designer/%.ui
	pyuic4 $< -o $@  
	
.PHONY : doc
	